import {defineStore} from "pinia";
import {ref} from "vue";

export const useMainStore = defineStore('main', ()=>{
    const collapsed = ref<boolean>(false)
    const theme = ref<ThemeType>('light')
    const toggleCollapsed = ()=>{
        collapsed.value = !collapsed.value
    }
    const setCollapsed = (val:boolean)=>{
        collapsed.value = val
    }
    const setTheme = (val:ThemeType)=>{
        theme.value = val
    }
    return {
        collapsed,
        toggleCollapsed,
        setCollapsed,
        theme,
        setTheme
    }
},{persist:true})